3.4.62 \(\int (f x)^{-1+m} (a+b \log (c x^n))^2 \, dx\) [362]

Optimal. Leaf size=69 \[ \frac {2 b^2 n^2 (f x)^m}{f m^3}-\frac {2 b n (f x)^m \left (a+b \log \left (c x^n\right )\right )}{f m^2}+\frac {(f x)^m \left (a+b \log \left (c x^n\right )\right )^2}{f m} \]

[Out]

2*b^2*n^2*(f*x)^m/f/m^3-2*b*n*(f*x)^m*(a+b*ln(c*x^n))/f/m^2+(f*x)^m*(a+b*ln(c*x^n))^2/f/m

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2342, 2341} \begin {gather*} -\frac {2 b n (f x)^m \left (a+b \log \left (c x^n\right )\right )}{f m^2}+\frac {(f x)^m \left (a+b \log \left (c x^n\right )\right )^2}{f m}+\frac {2 b^2 n^2 (f x)^m}{f m^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f*x)^(-1 + m)*(a + b*Log[c*x^n])^2,x]

[Out]

(2*b^2*n^2*(f*x)^m)/(f*m^3) - (2*b*n*(f*x)^m*(a + b*Log[c*x^n]))/(f*m^2) + ((f*x)^m*(a + b*Log[c*x^n])^2)/(f*m
)

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps

\begin {align*} \int (f x)^{-1+m} \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\frac {(f x)^m \left (a+b \log \left (c x^n\right )\right )^2}{f m}-\frac {(2 b n) \int (f x)^{-1+m} \left (a+b \log \left (c x^n\right )\right ) \, dx}{m}\\ &=\frac {2 b^2 n^2 (f x)^m}{f m^3}-\frac {2 b n (f x)^m \left (a+b \log \left (c x^n\right )\right )}{f m^2}+\frac {(f x)^m \left (a+b \log \left (c x^n\right )\right )^2}{f m}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 67, normalized size = 0.97 \begin {gather*} \frac {(f x)^m \left (a^2 m^2-2 a b m n+2 b^2 n^2+2 b m (a m-b n) \log \left (c x^n\right )+b^2 m^2 \log ^2\left (c x^n\right )\right )}{f m^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f*x)^(-1 + m)*(a + b*Log[c*x^n])^2,x]

[Out]

((f*x)^m*(a^2*m^2 - 2*a*b*m*n + 2*b^2*n^2 + 2*b*m*(a*m - b*n)*Log[c*x^n] + b^2*m^2*Log[c*x^n]^2))/(f*m^3)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.09, size = 1008, normalized size = 14.61

method result size
risch \(\text {Expression too large to display}\) \(1008\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x)^(-1+m)*(a+b*ln(c*x^n))^2,x,method=_RETURNVERBOSE)

[Out]

b^2/m*x*exp(1/2*(-1+m)*(-I*Pi*csgn(I*f*x)^3+I*Pi*csgn(I*f*x)^2*csgn(I*f)+I*Pi*csgn(I*f*x)^2*csgn(I*x)-I*Pi*csg
n(I*f*x)*csgn(I*f)*csgn(I*x)+2*ln(x)+2*ln(f)))*ln(x^n)^2+b*(-I*Pi*b*csgn(I*c)*csgn(I*x^n)*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n(I*c*x^n)^2+2*Pi^2*b^2*m^2*csgn(I*c)*csgn(I*x^n)^2*csgn(I*c*x^n)^3-4*Pi^2*b^2*m^2
*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4-4*I*Pi*ln(c)*b^2*m^2*csgn(I*c*x^n)^3-4*I*Pi*a*b*m^2*csgn(I*c*x^n)^3+4*I
*Pi*ln(c)*b^2*m^2*csgn(I*c)*csgn(I*c*x^n)^2+4*I*Pi*ln(c)*b^2*m^2*csgn(I*x^n)*csgn(I*c*x^n)^2)/m^3*x*exp(1/2*(-
1+m)*(-I*Pi*csgn(I*f*x)^3+I*Pi*csgn(I*f*x)^2*csgn(I*f)+I*Pi*csgn(I*f*x)^2*csgn(I*x)-I*Pi*csgn(I*f*x)*csgn(I*f)
*csgn(I*x)+2*ln(x)+2*ln(f)))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 117, normalized size = 1.70 \begin {gather*} -2 \, {\left (\frac {f^{m - 1} n x^{m} \log \left (c x^{n}\right )}{m^{2}} - \frac {f^{m - 1} n^{2} x^{m}}{m^{3}}\right )} b^{2} - \frac {2 \, a b f^{m - 1} n x^{m}}{m^{2}} + \frac {\left (f x\right )^{m} b^{2} \log \left (c x^{n}\right )^{2}}{f m} + \frac {2 \, \left (f x\right )^{m} a b \log \left (c x^{n}\right )}{f m} + \frac {\left (f x\right )^{m} a^{2}}{f m} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x)^(-1+m)*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

-2*(f^(m - 1)*n*x^m*log(c*x^n)/m^2 - f^(m - 1)*n^2*x^m/m^3)*b^2 - 2*a*b*f^(m - 1)*n*x^m/m^2 + (f*x)^m*b^2*log(
c*x^n)^2/(f*m) + 2*(f*x)^m*a*b*log(c*x^n)/(f*m) + (f*x)^m*a^2/(f*m)

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 124, normalized size = 1.80 \begin {gather*} \frac {{\left (b^{2} m^{2} n^{2} x \log \left (x\right )^{2} + b^{2} m^{2} x \log \left (c\right )^{2} + 2 \, {\left (a b m^{2} - b^{2} m n\right )} x \log \left (c\right ) + {\left (a^{2} m^{2} - 2 \, a b m n + 2 \, b^{2} n^{2}\right )} x + 2 \, {\left (b^{2} m^{2} n x \log \left (c\right ) + {\left (a b m^{2} n - b^{2} m n^{2}\right )} x\right )} \log \left (x\right )\right )} e^{\left ({\left (m - 1\right )} \log \left (f\right ) + {\left (m - 1\right )} \log \left (x\right )\right )}}{m^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x)^(-1+m)*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

(b^2*m^2*n^2*x*log(x)^2 + b^2*m^2*x*log(c)^2 + 2*(a*b*m^2 - b^2*m*n)*x*log(c) + (a^2*m^2 - 2*a*b*m*n + 2*b^2*n
^2)*x + 2*(b^2*m^2*n*x*log(c) + (a*b*m^2*n - b^2*m*n^2)*x)*log(x))*e^((m - 1)*log(f) + (m - 1)*log(x))/m^3

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 311 vs. \(2 (63) = 126\).
time = 16.34, size = 311, normalized size = 4.51 \begin {gather*} \begin {cases} \tilde {\infty } \left (a^{2} x - 2 a b n x + 2 a b x \log {\left (c x^{n} \right )} + 2 b^{2} n^{2} x - 2 b^{2} n x \log {\left (c x^{n} \right )} + b^{2} x \log {\left (c x^{n} \right )}^{2}\right ) & \text {for}\: f = 0 \wedge m = 0 \\0^{m - 1} \left (a^{2} x - 2 a b n x + 2 a b x \log {\left (c x^{n} \right )} + 2 b^{2} n^{2} x - 2 b^{2} n x \log {\left (c x^{n} \right )} + b^{2} x \log {\left (c x^{n} \right )}^{2}\right ) & \text {for}\: f = 0 \\\frac {\begin {cases} \frac {a^{2} \log {\left (c x^{n} \right )} + a b \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} \log {\left (c x^{n} \right )}^{3}}{3}}{n} & \text {for}\: n \neq 0 \\\left (a^{2} + 2 a b \log {\left (c \right )} + b^{2} \log {\left (c \right )}^{2}\right ) \log {\left (x \right )} & \text {otherwise} \end {cases}}{f} & \text {for}\: m = 0 \\\frac {a^{2} \left (f x\right )^{m}}{f m} + \frac {2 a b \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{f m} - \frac {2 a b n \left (f x\right )^{m}}{f m^{2}} + \frac {b^{2} \left (f x\right )^{m} \log {\left (c x^{n} \right )}^{2}}{f m} - \frac {2 b^{2} n \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{f m^{2}} + \frac {2 b^{2} n^{2} \left (f x\right )^{m}}{f m^{3}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x)**(-1+m)*(a+b*ln(c*x**n))**2,x)

[Out]

Piecewise((zoo*(a**2*x - 2*a*b*n*x + 2*a*b*x*log(c*x**n) + 2*b**2*n**2*x - 2*b**2*n*x*log(c*x**n) + b**2*x*log
(c*x**n)**2), Eq(f, 0) & Eq(m, 0)), (0**(m - 1)*(a**2*x - 2*a*b*n*x + 2*a*b*x*log(c*x**n) + 2*b**2*n**2*x - 2*
b**2*n*x*log(c*x**n) + b**2*x*log(c*x**n)**2), Eq(f, 0)), (Piecewise(((a**2*log(c*x**n) + a*b*log(c*x**n)**2 +
 b**2*log(c*x**n)**3/3)/n, Ne(n, 0)), ((a**2 + 2*a*b*log(c) + b**2*log(c)**2)*log(x), True))/f, Eq(m, 0)), (a*
*2*(f*x)**m/(f*m) + 2*a*b*(f*x)**m*log(c*x**n)/(f*m) - 2*a*b*n*(f*x)**m/(f*m**2) + b**2*(f*x)**m*log(c*x**n)**
2/(f*m) - 2*b**2*n*(f*x)**m*log(c*x**n)/(f*m**2) + 2*b**2*n**2*(f*x)**m/(f*m**3), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 198 vs. \(2 (69) = 138\).
time = 4.79, size = 198, normalized size = 2.87 \begin {gather*} \frac {b^{2} f^{m} n^{2} x^{m} \log \left (x\right )^{2}}{f m} + \frac {2 \, b^{2} f^{m} n x^{m} \log \left (c\right ) \log \left (x\right )}{f m} + \frac {b^{2} f^{m} x^{m} \log \left (c\right )^{2}}{f m} + \frac {2 \, a b f^{m} n x^{m} \log \left (x\right )}{f m} - \frac {2 \, b^{2} f^{m} n^{2} x^{m} \log \left (x\right )}{f m^{2}} + \frac {2 \, a b f^{m} x^{m} \log \left (c\right )}{f m} - \frac {2 \, b^{2} f^{m} n x^{m} \log \left (c\right )}{f m^{2}} + \frac {a^{2} f^{m} x^{m}}{f m} - \frac {2 \, a b f^{m} n x^{m}}{f m^{2}} + \frac {2 \, b^{2} f^{m} n^{2} x^{m}}{f m^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x)^(-1+m)*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

b^2*f^m*n^2*x^m*log(x)^2/(f*m) + 2*b^2*f^m*n*x^m*log(c)*log(x)/(f*m) + b^2*f^m*x^m*log(c)^2/(f*m) + 2*a*b*f^m*
n*x^m*log(x)/(f*m) - 2*b^2*f^m*n^2*x^m*log(x)/(f*m^2) + 2*a*b*f^m*x^m*log(c)/(f*m) - 2*b^2*f^m*n*x^m*log(c)/(f
*m^2) + a^2*f^m*x^m/(f*m) - 2*a*b*f^m*n*x^m/(f*m^2) + 2*b^2*f^m*n^2*x^m/(f*m^3)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (f\,x\right )}^{m-1}\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2 \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x)^(m - 1)*(a + b*log(c*x^n))^2,x)

[Out]

int((f*x)^(m - 1)*(a + b*log(c*x^n))^2, x)

________________________________________________________________________________________